﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<sg.edu.nus.iss.prettyfaces.DataAccessLayer.Message>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Inbox</h2>
    <table>
        <tr>
            <th></th>
            <th></th>
            <th>
                Message Id
            </th>
            <th>
                Created Date
            </th>
            <th>
                Sender
            </th>
            <th>
                Receiver
            </th>
            <th>
                Status
            </th>
            <th>
                Message
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Delete", "Delete", new { id=item.ID }) %> 
            </td>
            <td>
                <%= Html.ActionLink("Open", "openMessageById", new { id=item.ID })%>
            </td>
            <td>
                <%= Html.Encode(item.ID) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}",item.CreatedDate)) %>
            </td>
            <td>
                <%= Html.Encode(item.SenderUserId) %>
            </td>
            <td>
                <%= Html.Encode(item.ReceiverUserId) %>
            </td>
            <td>
                <%= Html.Encode(item.Status) %>
            </td>
            <td>
                <%= Html.Encode(item.Text) %>
            </td>
        </tr>
    
    <% } %>

    <p>
        <%= Html.ActionLink("Back to My Account", "Details") %>
    </p>

    </table>

</asp:Content>
